package com.trkj.pojo;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.sql.Timestamp;
import java.util.List;


/**
 * The persistent class for the MARITAL_STATUS database table.
 * 
 */
@Entity
@Table(name="MARITAL_STATUS")
@NamedQuery(name="MaritalStatus.findAll", query="SELECT m FROM MaritalStatus m")
public class MaritalStatus implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="MARITAL_STATUS_MARID_GENERATOR", sequenceName="HR")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="MARITAL_STATUS_MARID_GENERATOR")
	@Column(name="MAR_ID")
	private long marId;

	@Column(name="MAR_CREATORDATE")
	private Timestamp marCreatordate;

	@Column(name="MAR_NAME")
	private String marName;

	@Column(name="MAR_PERSON")
	private String marPerson;

	@Column(name="MAR_UPDATEDATE")
	private Timestamp marUpdatedate;

	//bi-directional many-to-one association to StaffInformation
	@OneToMany(mappedBy="maritalStatus")
	@JSONField(serialize=false)
	private List<StaffInformation> staffInformations;

	public MaritalStatus() {
	}

	public long getMarId() {
		return this.marId;
	}

	public void setMarId(long marId) {
		this.marId = marId;
	}

	public Timestamp getMarCreatordate() {
		return this.marCreatordate;
	}

	public void setMarCreatordate(Timestamp marCreatordate) {
		this.marCreatordate = marCreatordate;
	}

	public String getMarName() {
		return this.marName;
	}

	public void setMarName(String marName) {
		this.marName = marName;
	}

	public String getMarPerson() {
		return this.marPerson;
	}

	public void setMarPerson(String marPerson) {
		this.marPerson = marPerson;
	}

	public Timestamp getMarUpdatedate() {
		return this.marUpdatedate;
	}

	public void setMarUpdatedate(Timestamp marUpdatedate) {
		this.marUpdatedate = marUpdatedate;
	}

	public List<StaffInformation> getStaffInformations() {
		return this.staffInformations;
	}

	public void setStaffInformations(List<StaffInformation> staffInformations) {
		this.staffInformations = staffInformations;
	}

	public StaffInformation addStaffInformation(StaffInformation staffInformation) {
		getStaffInformations().add(staffInformation);
		staffInformation.setMaritalStatus(this);

		return staffInformation;
	}

	public StaffInformation removeStaffInformation(StaffInformation staffInformation) {
		getStaffInformations().remove(staffInformation);
		staffInformation.setMaritalStatus(null);

		return staffInformation;
	}

}